package model

import (
	"gorm.io/gorm"
	"time"
)

type BaseModel struct {
	ID       int       `gorm:"primarykey"`
	CreateAt time.Time `gorm:"column:create_time"`
	UpdateAt time.Time `gorm:"column:update_time"`
	DeleteAt gorm.DeletedAt
	IsDelete bool
}

type User struct {
	BaseModel
	UserName       string `gorm:"column:user_name;not null"`
	Password       string `gorm:"column:password;not null"`
	Phone          string `gorm:"column:phone;index:idx_phone;unique;type:varchar(11);not null"`
	Name           string `gorm:"column:name"`
	Identify       string `gorm:"column:identify;not null;unique"`
	RoleID         int    `gorm:"column:role_id;default:3"`
	MyHouseKeeping HouseKeeping
}
